<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <link rel="stylesheet" href="/static/bs/css/bootstrap.css">
    <style>
        .container{
            margin-top: 100px;
        }
        .btn{
            margin-top: 10px;
        }
    </style>
</head>
<body>

<h3>查看书籍</h3>

<div class="container">
     <div class="row">
         <div class="col-md-6 col-md-offset-3">
             <a href="/addbook/" class="btn btn-primary">添加书籍</a>
             <table class="table table-striped table-bordered">
                   <thead>
                        <tr>
                            <th>书籍名称</th>
                            <th>价格</th>
                            <th>出版日期</th>
                            <th>出版社</th>
                            <th>删除操作</th>
                            <th>编辑操作</th>
                        </tr>
                   </thead>
                   <tbody>
                        {% for book in book_list %}
                          <tr>
                              <td>{{ book.title }}</td>
                              <td>{{ book.price }}</td>
                              <td>{{ book.pub_date|date:'Y-m-d' }}</td>
                              <td>{{ book.publish }}</td>
                              <td><a href="/books/{{ book.pk }}/delete" class="btn btn-danger">删除</a></td>
                              <td><a href="/books/{{ book.pk }}/change" class="btn btn-info">编辑</a></td>
                          </tr>
                        {% endfor %}

                   </tbody>

             </table>

         </div>
     </div>
</div>



</body>
</html>